<!--
    * Time    : 2021-03-16 09:04:47
    * Author  : zhangTj
    * Desc    : 调查结果页面
-->

<template>
    <div class="w750">
        <div class="w-100 flex-center flex-column bg-main text-fff" style="height: 128px">
            <span class="iconfont iconselectItem"></span>
            <span class="mt-1">提交成功</span>
        </div>
        <div class="font-14" v-if="false">
            <p class="text-999 py-1 px-1">恭喜你获得</p>
            <div class="bg-fff px-1">
                <div class="d-flex a-center font-14 py-1 j-sb">
                    <span>优惠卷A</span>
                    <i class="iconfont iconArrowRight text-999" style="font-size: 14px"></i>
                </div>
                <div class="d-flex a-center font-14 py-1 j-sb">
                    <span>积分5分</span>
                    <i class="iconfont iconArrowRight text-999" style="font-size: 14px"></i>
                </div>
                <div class="d-flex a-center font-14 py-1 j-sb">
                    <span>积分5分</span>
                    <i class="iconfont iconArrowRight text-999" style="font-size: 14px"></i>
                </div>
            </div>
        </div>
        <div class="d-flex flex-column px-3 mt-4">
            <van-button v-if="Number(resultShowFlag)" @click="checkResult" type="primary" :color="themes.color" class="mb-15p">查看调研结果</van-button>
            <van-button @click="$replaceToPage('/')">返回首页</van-button>
        </div>
    </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
    name: 'questionnaireResult',
    components: {},
    data() {
        return {
            id: '', // 问卷结果id
            questionnaireId: '', // 问卷id
            resultShowFlag: '' // 是否能查看结果
        }
    },
    computed: {
        ...mapState(['themes'])
    },
    watch: {},
    created() {},
    destroyed() {},
    mounted() {
        if (this.$route.query.id) {
            this.id = this.$route.query.id
        }
        if (this.$route.query.questionnaireId) {
            this.questionnaireId = this.$route.query.questionnaireId
        }
        if (this.$route.query.resultShowFlag) {
            this.resultShowFlag = this.$route.query.resultShowFlag
        }
    },
    methods: {
        // 查看结果
        checkResult() {
            this.$replaceToPage('questionnaireTap', { id: this.id, questionnaireId: this.questionnaireId })
        }
    }
}
</script>
